

#include "flops_job.h"
#include "boost/function.hpp"
#include "boost/bind.hpp"
#include "boost/type_traits.hpp"
#include "boost/static_assert.hpp"
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h" 
#include "tbb/parallel_invoke.h"

#include <iostream>

#define print(msg)\
        ::std::cout << (msg) << ::std::endl;

using namespace tbb;


/*template <class Func>
struct Go {
	void operator()( const blocked_range<Func>& range ) const {
		for( int i=range.begin(); i!=range.end(); ++i ){
			Func();
		}
	}
};*/


int main(int argc, char** argv){
	

	boost::function<void (size_t,const char*)> f = static_cast<void (*)(size_t,const char*)>(::pilot::flops_job);

	boost::function<void ()> f4 = boost::bind(static_cast<void (*)(size_t,const char*)>(::pilot::flops_job),10,"#");

	boost::function<void ()> f1 = boost::bind(f,10,"%");
	boost::function<void ()> f2 = boost::bind(f,10,"*");
	boost::function<void ()> f3 = boost::bind(f,10,"\\");
	
	tbb::parallel_invoke(f1,f2,f3);

	return 0;
}




